class Solution:
    def getLucky(self, s: str, k: int) -> int:
        num = ""
        for it in s:
            num += str(ord(it) - ord('a') + 1)

        for j in range(k):
            num_tmp = 0
            for i in num:
                num_tmp += int(i)
            num = str(num_tmp)

        return int(num)
